<h2><a href="<?php echo $kong_href ?>"><i class="icon-quote-left"></i> <?php echo $kong_name ?></a></h2> 

<form class="form-horizontal" method="post" enctype="multipart/form-data">
	
	<input type="hidden" name="action" value="modify" />
	
	<legend>Modify Article</legend>
	
	<div class="control-group">
		<label class="control-label" for="select_category">Category</label>
		<div class="controls">
			<select name="category_idx" id="select_category">
				<option selected>--선택--</option>
<?php foreach ($category as $v) : ?>
				<option value="<?php echo $v['idx']?>"<?php echo ($v['idx']==$result['category_idx'])?" selected":"" ?>><?php echo $v['name']?></option>
<?php endforeach; ?>
			</select>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="subject">Subject</label>
		<div class="controls">
			<input type="text" name="subject" id="subject" required="1" class="span6" value="<?php echo $result['subject']?>" />
		</div>
	</div>

	<div class="control-group">
		<label class="control-label" for="contents">Contents</label>
		<div class="controls">
			<textarea name="contents" id="contents" class="redactor" data-imageup="http://<?php echo HOME?>/redactor/image" data-fileup="http://<?php echo HOME?>/redactor/file" style="height:300px;"><?php echo htmlspecialchars($result['subject']) ?></textarea>
		</div>
	</div>

	<div class="control-group">
		<label class="control-label" for="contents">Thumbnail</label>
		<div class="controls">
			<div class="btn btn-file" id="select_file">
				<i class="icon-file"></i>
				<span>Select File..</span>
			</div>
			<input type="file" name="thumbnail" />
		</div>
	</div>
<?php if ( isset($files['thumbnail'][0]) && file_exists( __ROOT__."/files/".urldecode($files['thumbnail'][0]) ) ) : ?>
	<div>
		<div class="controls">
			<img src="http://<?php echo HOME?>/img.php/<?php echo $files['thumbnail'][0] ?>" alt="thumbnail" />
		</div>
	</div>
<?php endif; ?>
	<div class="control-group">
		<div class="controls">
			<button type="submit" name="submit" id="submit" class="btn btn-primary">Write</button>
		</div>
	</div>

</form>

